function gPatterns = generatePatterns(imgpath, extension)
% GENERATEPATTERNS Summary of this function goes here
%   Detailed explanation goes here

global IMGSIZE;

images = getFileNamesByExtension(imgpath,extension);
qtyImages = length(images);

patterns = zeros(qtyImages, IMGSIZE*IMGSIZE);

for i = 1:length(images)
    pattern = imread(strcat(imgpath,images{i}));
    pattern = int8(pattern(:,:,1)./255).*2 - 1;     % transformacion a matriz de 1 y -1 (255 o 0)
    pattern = matrixToVector(pattern);
    patterns(i,:) = pattern;
end

gPatterns = patterns';
end